import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import(/* webpackChunkName: "layout" */ '@/views/layout.vue'),
    redirect:"/home",
    children: [
      {
        path: '/home',
        name: 'home',
        meta:{
          activeRoute:"/home"
        },
        component: () => import(/* webpackChunkName: "home" */ '@/views/home.vue'),
      },
      {
        path: '/examples',
        name: 'example',
        meta:{
          activeRoute:"/examples"
        },
        component: () => import(/* webpackChunkName: "example" */ '@/views/example/list.vue'),
      },
      {
        path: '/example/preview',
        name: 'examplePreview',
        meta:{
          activeRoute:"/examples"
        },
        component: () => import(/* webpackChunkName: "examplePreview" */ '@/views/example/preview.vue'),
      },
      {
        path: '/tools',
        name: 'tools',
        meta:{
          activeRoute:"/tools"
        },
        component: () => import(/* webpackChunkName: "toolslayout" */ '@/views/tools/layout.vue'),
        redirect:"/tools/list",
        children:[
          { 
            path: 'list',
            name: 'toolslist',
            meta:{
              activeRoute:"/tools"
            },
            component: () => import(/* webpackChunkName: "toolslist" */ '@/views/tools/list.vue'),
          },
          { 
            path: 'lnglat-transform',
            name: 'lnglat-transform',
            meta:{
              activeRoute:"/tools"
            },
            component: () => import(/* webpackChunkName: "lnglat-transform" */ '@/views/tools/lnglat-transform.vue'),
          }
        ]
      },
      {
        path: '/components',
        name: 'components',
        meta:{
          activeRoute:"/components"
        },
        component: () => import(/* webpackChunkName: "components" */ '@/views/components/list.vue'),
      },
      {
        path: '/onlinechat',
        name: 'onlinechat',
        meta:{
          activeRoute:"/onlinechat"
        },
        component: () => import(/* webpackChunkName: "onlinechat" */ '@/views/onlinechat/online-chat.vue'),
      },
      {
        path: '/onlineOffice',
        name: 'onlineOffice',
        meta:{
          activeRoute:"/onlineOffice"
        },
        component: () => import(/* webpackChunkName: "onlineOffice" */ '@/views/system/index.vue'),
        redirect:"/onlineOffice/online-xls",
        children:[
          {
            path: 'xlsList',
            name: 'xlsList',
            meta:{
              activeRoute:"/onlineOffice/xlsList"
            },
            component: () => import(/* webpackChunkName: "xlsList" */ '@/views/onlineoffice/online-xls-list.vue'),
          },
          {
            path: 'xls',
            name: 'xls',
            meta:{
              activeRoute:"/onlineOffice/xlsList"
            },
            component: () => import(/* webpackChunkName: "xlsList" */ '@/views/onlineoffice/online-xls.vue'),
          }
        ]
      },
      {
        path: '/system',
        name: 'system',
        meta:{
          activeRoute:"/system"
        },
        component: () => import(/* webpackChunkName: "systemlayout" */ '@/views/system/index.vue'),
        redirect:"/system/exampleType",
        children:[
          {
            path: 'exampleType',
            name: 'exampleType',
            meta:{
              activeRoute:"/system/exampleType"
            },
            component: () => import(/* webpackChunkName: "exampleType" */ '@/views/system/example-type.vue'),
          }
        ]
      }
    ],
  },
  {
    path: '/login',
    name: 'login',
    meta:{
      activeRoute:"/login"
    },
    component: () => import(/* webpackChunkName: "login" */ '@/views/login.vue'),
  }
]
const router = createRouter({
  history:createWebHashHistory(),
  routes
})

export default router